package io;

import java.io.*;

public class ObjectInputStreamDemo {
    public static void main(String[] args) throws IOException {
        //将一个Person的实例写入文件person.obj中保存


        String name = "苍老师";
        int age = 18;
        String gender = "男";
        String[] otherInfo = {"是个演员","来自日本","台词较少"};

        Person p = new Person(name,age,gender,otherInfo);
        System.out.println(p);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        /*





         */





        oos.writeObject(p);
        System.out.println("写出完毕！");
        oos.close();

















    }
}
